﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcMusicStore.ViewModels.ShoppingCartViewModel>" %>
<%--<%@ Import Namespace="Combres.Mvc" %>--%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Shopping cart
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <%--<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script> 
    <script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script> 
    <script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> 
    <script src="/Scripts/MyJavascript.js" type="text/javascript"></script> --%>
    
     <%--<%= Html.CombresLink("siteJs") %> --%>   
    
    <h2> Xem lại giỏ hàng: </h2>
    <p class="button"> 
        <%= Html.ActionLink("Checkout >>", "AddressAndPayment", "Checkout")%> 
    </p> 
    
    <div id="update-message"></div> 
    
    <table>
        <tr>
            <th>Tựa đề</th>
            <th>Giá</th>
            <th>Số lượng</th>
            <th></th>
        </tr>
        
        <%foreach (var item in Model.CartItems)
          {%> 
        <tr id="row-<%= item.RecordId %>">
            <td>
                <%=Html.ActionLink(item.Album.Title, "Details", "Store",
                    new { id = item.Album.AlbumId }, null)%>
            </td>
            <td><%=item.Album.Price * Convert.ToDecimal(ViewData["vat"])%> </td>
            <td class="textbox-quantity" data-id="<%=item.RecordId %>">
                <input type="text" value="<%=item.Count %>" size="2" maxlength="2" 
                id="item-count-<%=item.RecordId %>"
                onkeyup="ChangeQuantity(this);" 
                onchange="CheckQuantity(this);" />
            </td>
            <td>
                <a href="#" class="RemoveLink" data-id="<%=item.RecordId %>">
                    Bỏ khỏi giỏ hàng
                </a>
            </td>
        </tr>
        <%} %>
        
        <tr>
            <td>Tổng</td>
            <td id="cart-total">
                <%=Model.CartTotal * Convert.ToDecimal(ViewData["vat"])%>
            </td>
            <td></td>
            <td></td>
        </tr>
    </table>
</asp:Content>
